﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entity;

public partial class OrderTable : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }

    protected void btn_OK_Click(object sender, EventArgs e)
    {
        Order record = new Order();
        DateTime date = this.c_Date.SelectedDate;
        DateTime arrival = new DateTime(date.Year, date.Month, date.Day,
                                                            int.Parse(this.dpl_Time.SelectedValue), 0, 0);
        record.ArrivalTime = arrival;
        record.BookTime = DateTime.Now;
        record.TableNum = int.Parse(this.txt_TableNum.Text);
        record.TableID = int.Parse(Request.QueryString[0]);

        record.TableType = int.Parse(this.dpl_TableType.SelectedValue);

        record.Description = this.txt_Memo.Text;
        record.UserID = (int)Session["userid"];

        OrderManage om = new OrderManage();

       
        string text = om.AddRecord(record);
        {
            Response.Write("<script>alert('"+text+"')</script>");
            
        }
    

    }
}
